home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / uupc11ys.zip / LIB / TIMESTMP.C < prev    next >
C/C++ Source or Header  |  1993-04-17  |  3KB  |  99 lines

  1. /*--------------------------------------------------------------------*/
  2. /*    timestmp.c                                                      */
  3. /*                                                                    */
  4. /*    Compiler timestamps for display at program start-up             */
  5. /*                                                                    */
  6. /*    History:                                                        */
  7. /*                                                                    */
  8. /*       12/13/89 Add Copyright statements - ahd                      */
  9. /*--------------------------------------------------------------------*/
  10.  
  11. #include <dos.h>
  12. #include <direct.h>
  13. #include <io.h>
  14.  
  15. #include <stdio.h>
  16. #include <stdlib.h>
  17. #include <string.h>
  18.  
  19. #ifdef WIN32
  20. #include "win32ver.h"
  21. #endif
  22.  
  23. #include "lib.h"
  24. #include "timestmp.h"
  25.  
  26. #ifndef UUPCV
  27. #define UUPCV "1.11(experimental)"
  28. #endif
  29.  
  30. char compiled[] = { __DATE__ } ;
  31. char compilet[] = { __TIME__ } ;
  32. char compilev[] = { UUPCV } ;
  33.  
  34. char compilep[] = { "UUPC/extended" } ;
  35.  
  36. char *compilen  = compilep;
  37.  
  38. void banner (char **argv)
  39. {
  40.       char dummy[FILENAME_MAX];
  41.       char program[FILENAME_MAX];
  42.  
  43. /*--------------------------------------------------------------------*/
  44. /*                     Deterine the program name                      */
  45. /*--------------------------------------------------------------------*/
  46.  
  47. #ifdef __TURBOC__
  48.       if (  fnsplit(argv[0],dummy,dummy, program,dummy) && FILENAME )
  49.       {
  50. #else
  51.       if (!equal(argv[0],"C"))    /* Microsoft C for no prog name? */
  52.       {
  53.          _splitpath( argv[0], dummy , dummy , program , dummy );
  54. #endif /* __TURBOC__ */
  55.  
  56.          strcpy(argv[0], program);  /* Reset original program name   */
  57.          compilen = argv[0];
  58.  
  59. /*--------------------------------------------------------------------*/
  60. /*                 Return if input is not the console                 */
  61. /*--------------------------------------------------------------------*/
  62.  
  63.       if (!isatty(fileno(stdout))) /* Is the console I/O redirected?  */
  64.          return;                 /* Yes --> Run quietly              */
  65.  
  66. /*--------------------------------------------------------------------*/
  67. /*                       Print the program name                       */
  68. /*--------------------------------------------------------------------*/
  69.  
  70.          fprintf(stderr,"%s: ",program);
  71.       } /* if */
  72.  
  73. /*--------------------------------------------------------------------*/
  74. /*    Now print out the version, operating system (MS C only) and     */
  75. /*    timestamp                                                       */
  76. /*--------------------------------------------------------------------*/
  77.  
  78. #ifdef __TURBOC__
  79.       fprintf(stderr,"%s %s (%2.2s%3.3s%2.2s %5.5s)\n",
  80. #else
  81.       fprintf(stderr,"%s %s (%s mode, %2.2s%3.3s%2.2s %5.5s)\n",
  82. #endif
  83.                   compilep,
  84.                   compilev,
  85.  
  86. #ifdef WIN32
  87.                   "Windows 32 bit",
  88. #else
  89. #ifndef __TURBOC__
  90.                   (_osmode == DOS_MODE) ? "real" : "protected",
  91. #endif
  92. #endif
  93.  
  94.                   &compiled[4],
  95.                   &compiled[0],
  96.                   &compiled[9],
  97.                   compilet);
  98. } /* banner */
  99.